import request from '@/utils/request'

// 查询商品参数列表
export function listSpecification(query) {
  return request({
    url: '/catalog/specification/list',
    method: 'get',
    params: query
  })
}

// 查询商品参数详细
export function getSpecification(specificationId) {
  return request({
    url: '/catalog/specification/' + specificationId,
    method: 'get'
  })
}

// 新增商品参数
export function addSpecification(data) {
  return request({
    url: '/catalog/specification',
    method: 'post',
    data: data
  })
}

// 修改商品参数
export function updateSpecification(data) {
  return request({
    url: '/catalog/specification',
    method: 'put',
    data: data
  })
}

// 删除商品参数
export function delSpecification(specificationId) {
  return request({
    url: '/catalog/specification/' + specificationId,
    method: 'delete'
  })
}

// 导出商品参数
export function exportSpecification(query) {
  return request({
    url: '/catalog/specification/export',
    method: 'get',
    params: query
  })
}